home *** CD-ROM | disk | FTP | other *** search
- #!/usr/bin/awk -f
- # -*- awk -*-
- #
- # $Header: /usr/bfr/src/test/RCS/fts-f-split-decls,v 1.1 1995/01/18 17:39:14 abel Exp $
- #
- #********************************************
- #
- # split multiple decls of CHARACTER data
- #
- #********************************************
- #
- # Written by Alexander L. Belikoff, 1994
- # Copyright (C)1994 Alexander L. Belikoff
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- #********************************************
- #
- # $Log: fts-f-split-decls,v $
- # Revision 1.1 1995/01/18 17:39:14 abel
- # Initial revision
- #
- #
- #********************************************
-
-
- $0 ~ /^ +CHARACTER[ \t\*]/ && $0 ~ /,/ {
-
- res = $0
- gsub(/[ \t]*\*[ \t]*/, "*", res)
- gsub(/[ \t]*\([ \t]*/, "(", res)
- gsub(/[ \t]*\)[ \t]*/, ") ", res)
- gsub(/\) ,/, "),", res)
-
- res = substr(res, index(res, "C"))
- i1 = index(res, " ")
- typ = " " substr(res, 1, i1)
-
- npc = split(substr(res, i1), pieces, ",")
-
- i = 1
-
- while (i <= npc) {
- res = pieces[i]
- i++
-
- if (index(res, "(") && !index(res, ")")) {
- while (i <= npc) {
- res = res ", " pieces[i]
- i++
-
- if (index(res, ")"))
- break
- }
- }
-
- print typ " " res
- }
-
- next
- }
-
-
- { print }
-
- # end of $Source: /usr/bfr/src/test/RCS/fts-f-split-decls,v $
-